package updown.util;

import java.util.Random;

/**
 * <p>Title: ww.kaixin.downupservice.util </p>
 * <p>Description:updown: -  </p>
 *
 * @Author:jiangkaixin
 * @Date:2021/11/3
 * @Version: 1.0
 */
public class RandomUtil {
    public static String getRandomStr(){
        StringBuilder str=new StringBuilder();//定义变长字符串
        Random random=new Random();
        //随机生成数字，并添加到字符串
        for(int i=0;i<15;i++){
            str.append(random.nextInt(10));
        }
        //将字符串转换为数字并输出
        return str.toString();
    }

    public static String getRandomStr(String prefix){
        StringBuilder str=new StringBuilder();//定义变长字符串
        str.append(prefix);
        Random random=new Random();
        //随机生成数字，并添加到字符串
        for(int i=0;i<15;i++){
            str.append(random.nextInt(10));
        }
        //将字符串转换为数字并输出
        return str.toString();
    }
}
